from django.conf import settings as original_settings
from .models import Function

#系统当前状态获取
def set_year_term(request):
	year_lately_list=Function.objects.filter(state='end').order_by('-id')[:1]
	year_now_list=Function.objects.filter(state='active')
	lately_term='无' #系统无数据
	now_term='not'
	if year_lately_list:
		lately_term=year_lately_list[0].year_term
	if year_now_list:
		now_term=year_now_list[0].year_term
	return {'lately_term':lately_term,'now_term':now_term}

